<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*,model.*,util.*,control.*"%>
<%@ page import="model.Resources"%>
<%@ page import="control.ResourcesControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
   request.setCharacterEncoding("UTF-8");
   int id=ParamUtil.getInt(request,"id",0);
   String resources_name=ParamUtil.getString(request,"resources_name",null);
   String resources_type=ParamUtil.getString(request,"resources_type",null);
   String resources_path=ParamUtil.getString(request,"resources_path",null);
   String resources_introduction=ParamUtil.getString(request,"resources_introduction",null);
   int resources_isrecommend=ParamUtil.getInt(request,"resources_isrecommend",0);
   ResourcesControl rc=new ResourcesControl();
   Resources resources=new Resources();
   resources.setName(resources_name);
   resources.setType(resources_type);
   resources.setPath(resources_path);
   resources.setIntroduction(resources_introduction);
   resources.setIsRecommend(resources_isrecommend);
   if(rc.updateResources(resources,id))
   {
%>
    <script language="javascript">
        alert("修改成功");
       window.location.href="resources.jsp";
     </script>
<%} else { %>
    <script language="javascript">
       alert("修改失败");
       history.back();
     </script>
 <%
	  		}
%>
</body>
</html>